-
Notifications
You must be signed in to change notification settings - Fork 1.8k
finished work with inheritance about Machine #2408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Decision: REQUEST_CHANGES
Your OOP structure is solid: Machine
is abstract, subclasses override methods correctly, and MainApp
demonstrates polymorphism. However, there’s a critical blocker related to required output messages.
Issues to fix (critical blockers):
- Non-English and non-informative messages in
doWork()
andstopWork()
:- Files and lines (approximate, adjust to your file):
src/main/java/core/basesyntax/Bulldozer.java
: lines wheredoWork()
andstopWork()
print messagessrc/main/java/core/basesyntax/Excavator.java
: lines wheredoWork()
andstopWork()
print messagessrc/main/java/core/basesyntax/Truck.java
: lines wheredoWork()
andstopWork()
print messages
- Why: Violates the checklist item “Write informative messages in methods” and the requirement that messages be in English and explicitly state the machine started/stopped working.
- How to fix:
- Update each method to something like:
System.out.println("Bulldozer started working");
System.out.println("Bulldozer stopped working");
- Repeat similarly for
Excavator
andTruck
.
- Update each method to something like:
- Files and lines (approximate, adjust to your file):
- Non-English separator message in
MainApp
:- File:
src/main/java/core/basesyntax/MainApp.java
(the line with"--- Нова машина ---"
) - Why: All output should be in English for consistency with the checklist.
- How to fix: Change to
System.out.println("--- New machine ---");
or remove if not required by the task.
- File:
What you did well:
- Correct abstraction and inheritance setup.
- Proper use of
Machine[]
and polymorphic calls.
Once you update the messages to clear English statements indicating start/stop per machine, this should meet all requirements. Keep it up—you’re very close!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review
button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor
tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
public class Bulldozer extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Started зносити все живе"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message in doWork()
is not in English and does not clearly state that the Bulldozer started working. This violates the checklist item: "Write informative messages in methods." The message should be in English and explicitly mention that the Bulldozer started working.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Stopped зносити все живе"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message in stopWork()
is not in English and does not clearly state that the Bulldozer stopped working. This violates the checklist item: "Write informative messages in methods." The message should be in English and explicitly mention that the Bulldozer stopped working.
public class Excavator extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Started копати"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message in doWork()
is not in English and does not clearly state that the Excavator started working. This violates the checklist item: "Write informative messages in methods." The message should be in English and explicitly mention that the Excavator started working.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Stopped копати"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message in stopWork()
is not in English and does not clearly state that the Excavator stopped working. This violates the checklist item: "Write informative messages in methods." The message should be in English and explicitly mention that the Excavator stopped working.
|
||
// Виконуємо цикл для кожного об'єкта в масиві | ||
for (Machine machine : machines) { | ||
System.out.println("--- Нова машина ---"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message "--- Нова машина ---" is not in English. All output messages should be in English according to the checklist requirement: "Write informative messages in methods." Consider changing this to something like "--- New machine ---" for consistency.
public class Truck extends Machine { | ||
@Override | ||
public void doWork() { | ||
System.out.println("Started рухатись"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message in doWork()
is not in English and does not clearly state that the Truck started working. This violates the checklist item: "Write informative messages in methods." The message should be in English and explicitly mention that the Truck started working.
|
||
@Override | ||
public void stopWork() { | ||
System.out.println("Stopped рухатись"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The message in stopWork()
is not in English and does not clearly state that the Truck stopped working. This violates the checklist item: "Write informative messages in methods." The message should be in English and explicitly mention that the Truck stopped working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Decision: Request changes
Reason: Your implementation is solid in terms of OOP structure and polymorphism, but it violates an explicit checklist requirement: “Write informative messages in methods.” The output in doWork()
/stopWork()
for all machine subclasses must follow the exact, concise format “X started working” / “X stopped working.” This is a critical blocker because tests/checks likely expect these exact messages.
Critical issues to fix (with specifics and how to fix):
- src/main/java/core/basesyntax/Bulldozer.java
- doWork() — replace the message with:
System.out.println("Bulldozer started working");
- stopWork() — replace the message with:
System.out.println("Bulldozer stopped working");
- doWork() — replace the message with:
- src/main/java/core/basesyntax/Excavator.java
- doWork() — replace the message with:
System.out.println("Excavator started working");
- stopWork() — replace the message with:
System.out.println("Excavator stopped working");
- doWork() — replace the message with:
- src/main/java/core/basesyntax/Truck.java
- doWork() — replace the message with:
System.out.println("Truck started working");
- stopWork() — replace the message with:
System.out.println("Truck stopped working");
- doWork() — replace the message with:
Why this is required: The checklist explicitly requires concise, informative, and English messages that clearly state which machine started/stopped working. Overly descriptive or differently phrased strings will fail strict output checks.
What’s good: Your abstract class, method signatures, subclassing, and MainApp
polymorphic iteration are all correct and clean.
Please make the above message changes and resubmit. You’re very close—once updated, this should fully meet the requirements!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
Important
Fix the issues, commit the changes, and then re-request my review using the Re-request review
button2 in the Reviewers tab.
Tip
If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor
tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.
Caution
Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.
Footnotes
System.out.println("The bulldozer roars to life, " | ||
+ "its massive blade positioned and ready to push through earth and debris " | ||
+ "with relentless mechanical force."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item: "Write informative messages in methods". The message should be simple and clearly state that the Bulldozer started working, e.g., System.out.println("Bulldozer started working");
System.out.println("The bulldozer's engine winds down to silence," | ||
+ " leaving behind a transformed landscape of leveled " | ||
+ "ground and cleared pathways."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item: "Write informative messages in methods". The message should be simple and clearly state that the Bulldozer stopped working, e.g., System.out.println("Bulldozer stopped working");
System.out.println("The excavator's hydraulic arm extends with mechanical precision," | ||
+ " its bucket poised to bite deep into the earth and scoop away tons of soil."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item: "Write informative messages in methods". The message should be simple and clearly state that the Excavator started working, e.g., System.out.println("Excavator started working");
System.out.println("The excavator's arm retracts one final time, " | ||
+ "settling into rest position as the day's digging operations draw to a close."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item: "Write informative messages in methods". The message should be simple and clearly state that the Excavator stopped working, e.g., System.out.println("Excavator stopped working");
System.out.println("The truck's engine rumbles to life as the driver engages the gears," | ||
+ " ready to haul its heavy cargo across distances with steady determination."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item: "Write informative messages in methods". The message should be simple and clearly state that the Truck started working, e.g., System.out.println("Truck started working");
System.out.println("The truck comes to a final stop, " | ||
+ "its cargo safely delivered and its mission complete until " | ||
+ "the next journey begins."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This violates checklist item: "Write informative messages in methods". The message should be simple and clearly state that the Truck stopped working, e.g., System.out.println("Truck stopped working");
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Summary
Educational approval: Great work—your implementation cleanly meets the OOP requirements. The abstract Machine
with doWork()
and stopWork()
is correctly defined, and Truck
, Bulldozer
, and Excavator
provide clear, concise English outputs that identify the machine and action. MainApp
effectively demonstrates polymorphism by using a Machine[]
and invoking methods via abstract references.
What you did well:
- Clear adherence to abstraction and polymorphism (checklist 1.1–1.4, 2.4).
- Concise, informative messages and clean formatting (checklist 3.1, 4.1–4.3).
Minor polish ideas (optional):
- Consider consistent message phrasing across all classes (e.g., “started working” vs. “is working”) to keep outputs uniform.
You’re on the right track—nice job keeping it simple and correct. Keep practicing this pattern for future hierarchies!
✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨
No description provided.